#include "outinfo.h"

#include <algorithm>
#include "..\NTReco\utils.h"
#include "csvline.h"
using namespace std;
OutInfo::OutInfo( LineInfo&line )
{
	csvs.append(line._csv);
	//times
	beginTime = endTime = line.time;
	tag = line.tag;

	
}

 

OutInfo::~OutInfo()
{

}



QString OutInfo::toString( QChar sep/*=','*/,QChar strQua /*= '\"'*/ ) 
{
	QString misc;
	foreach(CSVLine c ,csvs) {
		misc += c.toString()+"\n";
	}
	return CSVLine(QStringList()<<
	ToString(beginTime)<<//time
		"NTFS"<<//src
		""<<//host
		""<<//user
		_csv[ACTION]<<//action
		_csv[TARGET]<<//target
		misc<<//misc
		_csv[TAMPER]//tampered
	).toString();
}

 

void OutInfo::combine( LineInfo & outinfo ) 
{	
	this->csvs.append(outinfo._csv);
	//times
	beginTime = min(beginTime,outinfo.time);
	endTime = max(endTime,outinfo.time);
	
}
